<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!-- Module day14 -->
		<title>day14 插入数据</title>
		<link href="../2_day/2_StuInfo.css" rel="stylesheet" />
		<script src="../JQuery/jquery-3.6.0.min.js"></script>
		<script>

			function e_spb_stu1(){
				$.ajax({//@CrossOrigin
					url:"http://localhost:8080/stu/insert",
					data:$("#8_form2").serialize(),
					
					success:function(data){
						console.log("success");
						$("#8_h4_1").text(JSON.stringify(data));
					},
					error:function(data){
						$("#8_h4_1").text(JSON.stringify(data));
						console.log("error");
					}
					
					
				})
			}
			
			
		</script>
	</head>
	<body>
		<h4 id="8_h4_1">8_h4_1 显示数据是否删除成功</h4>

		<form method="post" action="#" id="8_form2">
			<table border="1" bordercolor="white" bgcolor="#F0F8FF">
				<tr>
					<td colspan="2">
						<h1>学生信息管理系统MIS</h1>
					</td>
				</tr>
				<tr>
					<td>
						姓名：
					</td>
					<td>
						<input type="text" name="name" placeholder="请输入姓名..." />
					</td>
				</tr>
				<tr>
					<td>
						年龄：
					</td>
					<td>
						<input type="text" name="age" placeholder="请输入年龄..." />
					</td>
				</tr>
				<tr>
					<td>
						性别：
					</td>
					<td>
						<input type="radio" name="sex" value="1" checked="checked" />男
						<input type="radio" name="sex" value="2" />女
					</td>
				</tr>
				<tr>
					<td>
						爱好：
					</td>
					<td>
						<input type="checkbox" name="like" value="1" />乒乓球
						<input type="checkbox" checked="checked" name="like" value="2" />篮球
						<input type="checkbox" name="like" value="3" />足球
					</td>
				</tr>
				<tr>
					<td>
						学历：
					</td>
					<td>
						<select name="eduBackground">
							<option value="1">小学</option>
							<option value="2">初中</option>
							<option value="3" selected="selected">高中</option>
							<option value="4">专科</option>
							<option value="5">本科</option>
							<option value="6">硕士</option>
							<option value="7">博士</option>

						</select>
					</td>
				</tr>
				<tr>
					<td>
						入学日期：
					</td>
					<td>
						<input type="date" name="admissionDate" />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<input type="button" value="保存" class="buttonSubmit" onclick="e_spb_stu1();" />

						<!-- <input type="submit" name="保存" value="保存" class="buttonSubmit" /> -->
						<input type="reset" name="重置" value="取消" class="buttonReset" />
					</td>
				</tr>
			</table>

		</form>
	</body>
</html>
